/**
 * @file   test004.c
 * @brief  Testing BRR task with 0 quantum
 * Expected result: 000...
 */
#include "../header/common.h"
#include "../header/os.h"
#include "../header/uart.h"
#include "../header/trace.h"

#ifdef test004

const unsigned char PPP[] = {};
const unsigned int PT = sizeof(PPP)/2;
EVENT* print_event;
extern uint16_t trace_counter;

void generic_task(void)
{
	int arg = 0;
	arg = Task_GetArg();

    for(;;)
    {
        add_to_trace(arg);
    	Task_Next();
    }
}

int main(void) {
	//use pins 4,5,6 and 7 on Port D for output
	DDRD = (1<<PORTD4) | (1<<PORTD5) | (1<<PORTD6) | (1<<PORTD7);
	UART_BPS bitrate = UART_38400;
	uart_init(bitrate);

    print_event = Event_Init();

    Task_Create(generic_task, 0, BRR, 0);

    Event_Wait(print_event);
    print_trace();
    return 0;
}

#endif
